import request from '@/utils/request'
import {SERVER_URL} from '@/utils/common'
export function  getDepartmentListPage(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+'/department/getDepartmentListPage',
    method: 'post',
    data:params
  })
}


export function saveOrUpdate(params){
  return request({
    url: params.id ? SERVER_URL.SYSTEM_SERVER+`/department/update`: SERVER_URL.SYSTEM_SERVER+`/department/save`,
    method: 'post',
    data:params
  })
};

export function  getChildrenDepartmentByparentId(parentId) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+'/department/getChildrenDepartmentByparentId?parentId='+parentId,
    method: 'get',
  })
}


export function  getDepartmentInfoById(id) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+'/department/getDepartmentInfoById?id='+id,
    method: 'get',
  })
}

export function disabledOrEnabled(params) {
  return request({
    url: SERVER_URL.SYSTEM_SERVER+`/department/disabledOrEnabled`,
    method: 'get',
    params: params
  })
}

